#include <iostream>
using namespace std;
#include <iomanip>
#include <string>
#include <vector>
#include "token_define.h"
#ifndef __TRANSLATE_STACK__
#define __TRANSLATE_STACK__
//存放三地址码的结构体
typedef struct{
	int opt;
	string address1;
	string address2;
	string address3;
	three_address(){
		opt = END;
		address1 = "";
		address1 = "";
		address1 = "";
	}
	void set(int opt){
		this->opt = opt;	
	}
	void set(int opt, string address1){
		this->opt = opt;
		this->address1 = address1;
	}
	void set(int opt, string address1, string address2){
		this->opt = opt;
		this->address1 = address1;
		this->address2 = address2;
	}
	void set(int opt, string address1, string address2, string address3){
		this->opt = opt;
		this->address1 = address1;
		this->address2 = address2;
		this->address3 = address3;
	}
}three_address;
// 存放语法制导翻译的三地址码队列
class translate_list{
	private:
		vector<three_address> list;			//三地址码队列
		vector<int> roll_back_stack;		//等待回填队列
	public:
		void insert_goto(int IP);
		void insert_goto();
		void insert(int opt);
		void insert(int opt, string address1);
		void insert(int opt, string address1, string address2);
		void insert(int opt, string address1, string address2, string address3);
		void insert_back_point(int IP_number);
		void back_to_fill(int IP_number);
		void display();
};
void number_to_string(int IP, string &dock);
#endif
